using System;
using System.Collections.Generic;
using System.Text;

namespace Developex.GenerateClassOnShema.Classes
{
	public class Table
	{
		public string TableName;

		public List<Column> Columns = new List<Column>();

		public Column this[string columnName]
		{
			get
			{
				foreach (Column column in Columns)
				{
					if (column.Name == columnName)
						return column;
				}
				throw new IndexOutOfRangeException("Cannot find column " + columnName);
			}
		}

		public bool Contains(string columnName)
		{
			foreach (Column column in Columns)
			{
				if (column.Name == columnName)
					return true;
			}
			return false;
		}

		public Table(string tableName)
		{
			TableName = tableName;
		}
	}
}
